<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./js/axios.js"></script>
</head>
<body>
  <h1>登录</h1>
  <label for="#">用户名</label>
  <input type="text" id="username"><br>
  <label for="#">密码</label>
  <input type="text" id="password"><br>
  <button id="user">登录用户</button>
  <script>
    user.onclick = async function() {
      const uname = username.value
      const pwd = password.value
      const { data } = await axios.post('/login', {
        uname,pwd
      })
      console.log(data);
    }
  </script>
</body>
</html>